package com.mdlib.helper.module.location;

import android.app.Activity;
import android.content.Intent;

import com.ljlib.core.base.BaseCommonActivity;
import com.ljlib.core.base.BaseFragment;
import com.mdlib.helper.ui.UIHelper;

/**
 * Created by librabin on 16/12/16.
 */

public class MapActivity extends BaseCommonActivity {

    public static final int REQUEST_ADDRESS_CODE = 101;

    public static final String EXTRA_ADDRESS_MAP = "extra_address_map";


    public static Intent newIntent(Activity activity, String keyword, String city, String type, String buyType) {
        Intent intent = new Intent(activity, MapActivity.class);
        intent.putExtra(LocationFragment.EXTRA_KEYWORD, keyword);
        intent.putExtra(LocationFragment.EXTRA_CITY, city);
        intent.putExtra(UIHelper.MAP_TYPE, type);
        intent.putExtra(UIHelper.BUY_TYPE, buyType);
        return intent;
    }


    @Override
    protected BaseFragment getFirstFragment() {
        return LocationFragment.newInstance(
                getIntent().getStringExtra(LocationFragment.EXTRA_KEYWORD),
                getIntent().getStringExtra(LocationFragment.EXTRA_CITY),
                getIntent().getStringExtra(UIHelper.MAP_TYPE),
                getIntent().getStringExtra(UIHelper.BUY_TYPE));
    }
}
